package cn.stronglink.assetmanage.index.holder;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import net.wujingchao.android.view.SimpleTagImageView;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.stronglink.assetmanage.R;
import cn.stronglink.assetmanage.index.view.onRecyclerListener;

/**
 * @author zww
 * 2018 2018/6/10 18:14
 */
public class MenuHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    @BindView(R.id.imgModule)
    public SimpleTagImageView imgModule;
    @BindView(R.id.tvModuleName)
    public TextView tvModuleName;
    private onRecyclerListener listener;

    public MenuHolder(@NonNull View itemView, onRecyclerListener rls) {
        super(itemView);
        this.listener = rls;
        ButterKnife.bind(this, itemView);
        itemView.setOnClickListener(this);
    }
    @Override
    public void onClick(View view) {
        if (listener != null) {
            listener.onItemClicked(view, getAdapterPosition());
        }
    }
}
